-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[google_maps_flutter] Take snapshot of map #2607
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! and we'll verify it. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I left some comments!
...le_maps_flutter/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java
Show resolved
Hide resolved
|
||
final GoogleMapInspector inspector = await inspectorCompleter.future; | ||
final Uint8List bytes = await inspector.takeSnapshot(); | ||
expect(bytes, isNotNull); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably remove this as if bytes
is null, the below test would fail as well.
packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapController.m
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo nits. Thanks!
AUTHORS
Outdated
Giancarlo Rocha <giancarloiff@gmail.com> | ||
Ryo Miyake <ryo@miyake.id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add new line EOF here?
@@ -1,3 +1,7 @@ | |||
## 0.5.25+1 | |||
|
|||
* Added function for taking a snapshot of the map. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits: Add
takeSnapshot that takes a snapshot of the map.
@@ -2,6 +2,8 @@ | |||
// for details. All rights reserved. Use of this source code is governed by a | |||
// BSD-style license that can be found in the LICENSE file. | |||
|
|||
import 'dart:typed_data'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits: remove extra line here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's required to use Uint8List.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! extra line. ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
thanks! |
I need to take the snapshot once the map widget has been renderer:
I get a crash on iOS (stable version)
|
@fvisticot Thanks for finding this out. Do you mind open an issue with details about this crash and tag me there? |
I've filed an issue with reproduction steps: flutter/flutter#81690 |
Description
Added function for taking a snapshot of the map
Related Issues
#1719
flutter/flutter#33557
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?